home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Dev / Bgui / AutoDoc / popbuttonclass.doc < prev    next >
Encoding:
Text File  |  2000-05-09  |  5.7 KB  |  184 lines

  1. TABLE OF CONTENTS
  2.  
  3. popbuttonclass/--background--
  4. popbuttonclass/Methods
  5. popbuttonclass/Attributes
  6.  
  7. popbuttonclass/--background--
  8.  
  9. NAME
  10.  
  11.     Class:     popbuttonclass
  12.     Superclass: baseclass
  13.     Include File:  <libraries/bgui.h>
  14.  
  15. FUNCTION
  16.  
  17.     To provide you with a class similar  to the  cycle  class in  pop-menu
  18.     mode. This class however appears to be a button gadget which will snap
  19.     down a menu for the user to select an entry without  changing anything
  20.     to the apperance of the object itself.
  21.  
  22.     Also a checkable (toggle)  mode  with or  without mutual  exclusion is
  23.     supported.
  24.  
  25.     Sunmouse/Sunkey/AutoPopWindowToFront etc. tools  may  cause  confusion
  26.     in combination with this class. When another window is activated while
  27.     the popmenu is up  intuition will  automatically  deactivate  the menu
  28.     selection.
  29.  
  30.     Objects  from  this  class  send out  the following attribute pairs in
  31.     their notification messages:
  32.  
  33.     GA_ID            - Gadget object ID.
  34.     PMB_MenuNumber   - Number of the selected menu.
  35.  
  36. popbuttonclass/Methods
  37.  
  38. NEW METHODS
  39.  
  40.     PMBM_CHECK_STATUS -- This method must  be  used to  see if  a  menu is
  41.             checked or not.   The  following  custom  message structure is
  42.             used:
  43.  
  44.             struct pmbmCommand {
  45.                     ULONG                MethodID;
  46.                     ULONG                pmbm_MenuNumber;
  47.             };
  48.  
  49.             pmbm_MenuNumber -- This must be the ordinal number of the menu
  50.                     on which the action is done. Please note that you must
  51.                     make sure that this value  is in  range  otherwise you
  52.                     definitly will get enforcer hits.
  53.  
  54.             Returns TRUE when the menu is checked and FALSE if not.
  55.  
  56.     PMBM_CHECK_MENU -- Use this method to check a menu.   It uses the same
  57.             message structure as PMB_CHECK_STATUS.
  58.  
  59.     PMBM_UNCHECK_MENU -- Use this method to un-check a menu.  It  uses the
  60.             same message structure as PMB_CHECK_STATUS.
  61.  
  62.     PMBM_ENABLE_ITEM -- Use this method to enable a menu item. It uses
  63.             the same message structure as PMB_CHECK_STATUS. Added by
  64.             NMC (12.12.95).
  65.  
  66.     PMBM_DISABLE_ITEM -- Use this method to disable a menu item. It uses
  67.             the same message structure as PMB_CHECK_STATUS. Added by
  68.             NMC (12.12.95).
  69.  
  70.     PMBM_ENABLE_STATUS -- Use this method to find out if a menu item
  71.             is enabled or disabled. It uses the same message structure
  72.             as PMB_CHECK_STATUS. Added by NMC (12.12.95).
  73.  
  74.             Returns TRUE when the menu is enabled and FALSE if not.
  75.  
  76.  
  77. CHANGED METHODS
  78.  
  79.     None.
  80.  
  81.  
  82. popbuttonclass/Attributes
  83.  
  84. NOTE
  85.  
  86.     All  baseclass  attributes  are  also  valid  for this class. Also the
  87.     vectorclass attributes can be used with  OM_SET on objects  from  this
  88.     class.
  89.  
  90.  
  91. NAME
  92.  
  93.     PMB_Image -- ( struct Image * )
  94.  
  95. FUNCTION
  96.  
  97.     To provide the object with a standard Intuition image or BOOPSI image.
  98.     The image will be centered inside the object it's hitbox.   This  will
  99.     override any vectorclass image.
  100.  
  101.     Default is NULL. Applicability is (IS).
  102.  
  103.  
  104. NAME
  105.  
  106.     PMB_MenuEntries -- ( UBYTE ** )
  107.  
  108. FUNCTION
  109.  
  110.     To   specify  the  actual  menu  entries.     This  must  point  to an
  111.     array of PopMenu structures. The array must be terminated with  a NULL
  112.     pm_Label entry.
  113.  
  114.     struct PopMenu {
  115.             UBYTE  *pm_label;
  116.             UWORD   pm_Flags;
  117.             ULONG   pm_MutualExclude;
  118.     };
  119.  
  120.     pm_Label -- This should be a pointer to  a  0-terminated  string which
  121.             contains the text for this menu.  You can specify PMB_BARLABEL
  122.             here to get a seperator bar simular to the seperator  bar used
  123.             by gadtools. If you make this NULL the array is terminated.
  124.  
  125.     pm_Flags -- The following two flags are supported:
  126.  
  127.             PMF_CHECKIT -- When set, this flag tell's the class  that this
  128.                     menu should toggle it's selected  status.  A checkmark
  129.                     image is shown when the menu is selected.
  130.  
  131.             PMF_CHECKED -- When set the menu is selected.
  132.  
  133.             PMF_DISABLED -- When set, the menu item is disabled and
  134.                     cannot be selected by the user. If it's a check
  135.                     item, it can still be checked and unchecked by
  136.                     the application). Added by NMC (12.12.95).
  137.  
  138.     pm_MutualExclude -- This 32 bit value can  hold bits  which  represent
  139.             menus which should be de-selected when this menu is checked.
  140.  
  141.             Each set bit means to  exclude        a menu.  I.E. When bit four is
  142.             set the fourth menu is de-selected if it is a  checkable item.
  143.  
  144.             NOTE: Mutually-excluded   items   will *not* trigger   any
  145.             notification so you are responsible to keep track of this.
  146.  
  147.             Please take a look at the supplied demo for a working example.
  148.  
  149.     The class will make a private copy of the PopMenu  array so  the menus
  150.     may be used on more than one object.
  151.  
  152.     Default is NULL. Applicability is (I).
  153.  
  154.  
  155. NAME
  156.  
  157.     PMB_MenuNumber -- ( ULONG )
  158.  
  159. FUNCTION
  160.  
  161.     This  attribute  holds  the  ordinal number of the last selected menu.
  162.     When your application is notified  by the  gadget  you  should  OM_GET
  163.     this attribute to find out which menu was selected.
  164.  
  165.     Applicability is (GN).
  166.  
  167.  
  168. NAME
  169.  
  170.     PMB_PopPosition -- ( ULONG )
  171.  
  172. FUNCTION
  173.  
  174.     To make the class pop the menu  with a  specific  entry as  the  first
  175.     one activated. When the object is activated by a mouse-click  the menu
  176.     will try to open with the specified item under the mouse pointer. Key-
  177.     board activation will simple pop the menu with the item selected.
  178.  
  179.     NMC (10.12.95) - Specifying a PMB_PopPosition of ~0 makes the menu
  180.     always open under the object, even when activated by a mouse-click.
  181.  
  182.     Applicability is (I).
  183.  
  184.